<!--

    Copyright (c) 2010-2025 Eclipse Dirigible contributors

    All rights reserved. This program and the accompanying materials
    are made available under the terms of the Eclipse Public License v2.0
    which accompanies this distribution, and is available at
    http://www.eclipse.org/legal/epl-v20.html

    SPDX-FileCopyrightText: Eclipse Dirigible contributors
    SPDX-License-Identifier: EPL-2.0

-->
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" ng-app="page" ng-controller="PageController">

    <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="icon" sizes="any" href="data:;base64,iVBORw0KGgo=">
        <title config-title></title>
        <script type="text/javascript" src="/services/web/editor-extensions/configs/extension-editor.js"></script>
        <script type="text/javascript" src="/services/js/platform-core/services/loader.js?id=editor-js"></script>
        <link type="text/css" rel="stylesheet" href="/services/js/platform-core/services/loader.js?id=view-css" />
        <script type="text/javascript" src="/services/web/editor-extensions/editors/extension/editor.js"></script>
    </head>

    <body class="bk-vbox bk-center--vertical" bk-scrollbar shortcut="'ctrl+s'" shortcut-action="save">
        <bk-busy-indicator-extended class="bk-fill-parent" ng-hide="state.error || !state.isBusy" size="l">
            {{state.busyText}}
        </bk-busy-indicator-extended>
        <div class="bk-restrict-width bk-full-width" ng-show="!state.error && !state.isBusy">
            <bk-fieldset class="fd-margin-begin-end--sm" ng-form="forms.editor">
                <bk-form-group label="Extension:" name="entityForm">
                    <bk-form-item horizontal="false">
                        <bk-form-label for="idExtensionPoint" required colon="true">Extension Point</bk-form-label>
                        <bk-combobox-input id="idExtensionPoint" name="extensionPoint" state="{{ formErrors.extensionPoint ? 'error' : '' }}" ng-required="true" ng-model="extension.extensionPoint" dropdown-items="optionsExtensionPoints"
                            placeholder="Search Extension Point..." btn-aria-label="show/hide extension point options" list-aria-label="extension point options" max-body-height="260">
                        </bk-combobox-input>
                    </bk-form-item>
                    <bk-form-item horizontal="false">
                        <bk-form-label for="idModule" required colon="true">Module</bk-form-label>
                        <bk-form-input-message state="{{ forms.editor['module'].$valid ? '' : 'error' }}" message="::inputErrorMessage">
                            <bk-input id="idModule" name="module" type="text" placeholder="Enter module path" state="{{ forms.editor['module'].$valid ? '' : 'error' }}" ng-required="true" ng-model="extension.module" ng-maxlength="255"
                                input-rules="{ patterns: ['^[a-zA-Z0-9_.-/$-]*$'] }"></bk-input>
                        </bk-form-input-message>
                    </bk-form-item>
                    <bk-form-item horizontal="false">
                        <bk-form-label for="idRole" colon="true">Role</bk-form-label>
                        <bk-form-input-message state="{{ forms.editor['role'].$valid ? '' : 'error' }}" message="::inputErrorMessage">
                            <bk-input id="idRole" name="role" type="text" placeholder="Enter role name" state="{{ forms.editor['role'].$valid ? '' : 'error' }}" ng-required="false" ng-model="extension.role" ng-maxlength="255"
                                input-rules="{ patterns: ['^[a-zA-Z0-9_,.-/$-]*$'] }"></bk-input>
                        </bk-form-input-message>
                    </bk-form-item>
                    <bk-form-item horizontal="false">
                        <bk-form-label for="idDescription" colon="true">Description</bk-form-label>
                        <bk-textarea id="idDescription" name="description" ng-required="false" ng-model="extension.description" placeholder="Enter description" ng-maxlength="255"></bk-textarea>
                    </bk-form-item>
                    <bk-form-item horizontal="false" class="bk-box--items-end">
                        <bk-button compact="true" state="emphasized" label="Save" ng-click="save()" ng-disabled="!forms.editor.$valid || !changed"></bk-button>
                    </bk-form-item>
                </bk-form-group>
            </bk-fieldset>
        </div>
        <bk-message-page glyph="sap-icon--error" ng-if="state.error">
            <bk-message-page-title>Editor encounterd an error!</bk-message-page-title>
            <bk-message-page-subtitle>{{errorMessage}}</bk-message-page-subtitle>
        </bk-message-page>
        <theme></theme>
    </body>

</html>
